<?php

namespace app\factory\controller;

use app\common\respond\HttpApi;
use app\factory\logic\FactoryUserLogic;

class FactoryUserController
{
    /**
     * @Description 新增/编辑
     * @author: zj
     * @param HttpApi $respond
     * @time 2024/03/12 15:39:06
     * @return \think\response\Json
     */
    public function addEdit(HttpApi $respond)
    {
        $param = [
            'Id' => request()->post('Id'),
            'NickName' => request()->post('NickName'),
            'UserName' => request()->post('UserName'),
            'PassWord' => request()->post('PassWord'),
            'RecordTime' => request()->post('RecordTime'),
        ];
        $rule = [
            'Id' => 'require|integer|>:0',
            'RecordTime' => 'require|integer|>:0',
        ];
        validate($rule)->check($param);

        $logic = new FactoryUserLogic();
        $data = $logic->addEdit($param['Id'],$param);

        return $respond->success([]);
    }

}